Skip to content

Refactor/#201#203

Merged
lsh2613 merged 5 commits intodevfrom
refactor/#201
Jul 15, 2025
Merged

Refactor/#201#203
lsh2613 merged 5 commits intodevfrom
refactor/#201

Conversation

@lsh2613
Copy link
Contributor

@lsh2613 lsh2613 commented Jul 15, 2025

⭐ Summary

#201


📌 Tasks

  1. 배포 환경에서 jar 실행 시 prod 프로필 적용
  2. UnindentedException -> UndefinedException 이름 수정
  3. CORS allowdOrigins를 value를 활용한 외부 프로퍼티로 변경

@lsh2613 lsh2613 requested a review from jeongmallro July 15, 2025 04:49
@lsh2613 lsh2613 self-assigned this Jul 15, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 15, 2025

📝 Walkthrough

Walkthrough

이 변경사항은 Spring Boot 애플리케이션의 CORS 허용 오리진을 외부 설정으로 분리하고, 스크립트에서 프로덕션 프로필을 명시적으로 활성화하며, 예외 로깅 메시지와 예외 로깅 클래스명을 일부 수정합니다. 또한, 관련 설정 값이 application.yml에 추가되었습니다.

Changes

파일/경로 변경 요약
scripts/start.sh Spring 프로필을 prod로 명시하여 jar 실행 명령어 수정
src/main/java/com/pitchain/common/aspect/GeneralExceptionLoggingAspect.java 예외 로깅 메시지의 placeholder를 "EXCEPTION"에서 "ERROR CODE"로 변경
src/main/java/com/pitchain/common/aspect/UndefinedExceptionLoggingAspect.java 클래스명 UnintendedExceptionLoggingAspect → UndefinedExceptionLoggingAspect로 변경
src/main/java/com/pitchain/common/config/SecurityConfig.java CORS 허용 오리진을 프로퍼티로 외부화, 관련 배열 상단으로 이동, PasswordEncoder 메서드 하단으로 이동
src/main/resources/application.yml spring.cors.allowed-origins 프로퍼티 추가 (환경변수 연동)

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant SpringApp
    participant ApplicationYML

    Client->>SpringApp: HTTP 요청 (CORS)
    SpringApp->>ApplicationYML: allowed-origins 값 로드
    ApplicationYML-->>SpringApp: CORS 허용 오리진 반환
    SpringApp->>Client: CORS 정책에 따라 응답
Loading

Possibly related PRs

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe4954e and 1f2c64c.

📒 Files selected for processing (5)
  • scripts/start.sh (1 hunks)
  • src/main/java/com/pitchain/common/aspect/GeneralExceptionLoggingAspect.java (1 hunks)
  • src/main/java/com/pitchain/common/aspect/UndefinedExceptionLoggingAspect.java (1 hunks)
  • src/main/java/com/pitchain/common/config/SecurityConfig.java (4 hunks)
  • src/main/resources/application.yml (1 hunks)
🔇 Additional comments (7)
src/main/resources/application.yml (1)

12-13: CORS 설정 외부화가 적절하게 구현되었습니다

환경 변수를 통한 CORS 허용 오리진 설정은 보안과 환경별 배포 관리 측면에서 좋은 접근입니다.

src/main/java/com/pitchain/common/aspect/UndefinedExceptionLoggingAspect.java (1)

28-28: 클래스명 변경이 의미적으로 더 정확합니다

"UnintendedExceptionLoggingAspect"에서 "UndefinedExceptionLoggingAspect"로의 변경은 정의되지 않은 예외를 처리한다는 클래스의 역할을 더 명확하게 표현합니다.

src/main/java/com/pitchain/common/aspect/GeneralExceptionLoggingAspect.java (1)

38-40: 로그 메시지 라벨이 더 정확해졌습니다

"EXCEPTION"에서 "ERROR CODE"로 변경하여 실제로 로깅되는 값(errorStatus.getCode())을 더 정확하게 설명합니다.

scripts/start.sh (1)

32-34: 프로덕션 프로파일 명시적 활성화가 적절합니다

배포 환경에서 --spring.profiles.active=prod 옵션을 명시적으로 추가하여 프로덕션 설정이 확실하게 적용되도록 보장합니다.

src/main/java/com/pitchain/common/config/SecurityConfig.java (3)

43-61: URL 패턴 상수화로 코드 구성이 개선되었습니다

URL 패턴들을 클래스 상단의 static final 필드로 이동하여 코드의 가독성과 유지보수성이 향상되었습니다.


94-94: 하드코딩된 localhost에서 외부 설정으로 변경이 완료되었습니다

setAllowedOrigins(List.of("http://localhost:3000"))에서 주입된 allowedOrigins 사용으로 변경하여 환경별 설정이 가능해졌습니다.


130-133: PasswordEncoder 빈 위치 이동은 단순한 코드 정리입니다

메서드의 기능적 변경 없이 클래스 하단으로 이동한 것은 코드 구성 개선입니다.

Copy link
Contributor

@jeongmallro jeongmallro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다~

@lsh2613 lsh2613 merged commit e1b7129 into dev Jul 15, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants